<template>
  <div class="movie-list-container">
    <div class="movie-list-header">
      <span class="movie-list-header-title">{{title}}</span>
      <span class="more" @click="handleClick">查看更多<i-icon type="enter" size="14" color="#67ba62" /></span>
    </div>
    <scroll-view scroll-x class="movies">
      <div class="movie-item" v-for="(item, index) in movies" :key="index" :id="index">
        <movie-thum :movie="item"></movie-thum>
      </div>
    </scroll-view>
  </div>
</template>

<script>
import MovieThum from '../../../components/MovieThum'
export default {
  props: {
    movies: {
      type: Array
    },
    title: {
      type: String
    }
  },
  components: {
    MovieThum
  },
  methods: {
    handleClick () {
      wx.navigateTo({
        url: '/pages/more-movies/main?title=' + this.title
      })
    }
  }
}
</script>

<style lang="less" scoped>
.movie-list-container {
  box-sizing: border-box;
  padding: 10rpx 20rpx;
  .movie-list-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10rpx 20rpx;
    box-sizing: border-box;
    font-size: 16px;
    &-title {
      color: #707070;
      font-weight: 600;
    }
    .more {
      color: #67ba62;
    }
  }
  .movies {
    width: 100%;
    white-space: nowrap;
    margin-top: 15rpx;
    .movie-item {
      width: 220rpx;
      height: 380rpx;
      display:inline-block;
    }
  }
}
</style>

